<template>
	<div>
		<div>
			<el-row>
				<el-col :span="12">
					<el-button type="primary" @click="updateDbtableEdit">修改</el-button>
					<el-button type="primary" @click="import_table">导入</el-button>
					<el-button type="primary" @click="add_script">新增脚本</el-button>
					<el-button type="primary" @click="update_script">修改脚本</el-button>
					<el-button type="primary" @click="delete_script">删除脚本</el-button>
				</el-col>
				<el-col :span="10">
					<el-input placeholder="请输入表名进行查询" v-model="p_Dbtable_de">
						<template slot="prepend">表:</template>
					</el-input>
				</el-col>
				<el-col :span="2">
					<el-button type="primary" @click="showdata()">查询</el-button>
				</el-col>
			</el-row>
			<br />
			<br/>
		</div>
		<el-row>
			<el-col :span="5">
				<div class="setheight_scroller">
					<el-menu :default-active="onRoutes" mode="vertical" active-text-color="#ffd04b" unique-opened @select="onselect">
						<template v-for="(item,index) in items">
							<template v-if="item.subs">
								<el-submenu :index="item.id">
									<template slot="title"><span><i :class="item.icon" ></i><i class="el-icon-menu"></i>{{ item.table_name }}</span></template>
									<template v-for="subItem in item.subs">
										<template v-if="subItem.subs">
											<el-submenu :index="subItem.id">
												<template slot="title">{{ subItem.table_name }}</template>
											</el-submenu>
										</template>
										<template v-else>
											<el-menu-item :index="subItem.id">
												<i class="el-icon-tickets"></i>{{ subItem.table_name }}
											</el-menu-item>
										</template>
									</template>
								</el-submenu>
							</template>
							<template v-else>
								<el-menu-item :index="item.id">
									<i :class="item.icon"></i>{{ item.describe }}
								</el-menu-item>
							</template>
						</template>
					</el-menu>
				</div>
			</el-col>

			<el-col :span="19">
				<el-card class="box-card" style="height: 650px;">
					<div>
						<el-col :span="2">
							<h3>表说明</h3>
						</el-col>
						<el-col :span="8">
							<el-tag style="border:0px ;" size="medium" color="#ffffff">{{textarea}}</el-tag>
						</el-col>
					</div>
					<br />
					<br />
					</br>
					<el-table :data="DbTableData" showOverflowTooltip style="width: 100%" stripe border tooltip-effect="dark" height="500">
						<!--<el-table-column type="selection" width="50" > </el-table-column>-->
						<el-table-column width="180px" prop="colname" label="列名" show-overflow-tooltip></el-table-column>
						<el-table-column prop="datatype" label="类型" show-overflow-tooltip></el-table-column>
						<el-table-column prop="collength" label="长度" show-overflow-tooltip></el-table-column>
						<el-table-column width="60px" prop="scale" label="小数位数" show-overflow-tooltip></el-table-column>
						<el-table-column prop="isnullable" label="是否可空" show-overflow-tooltip :formatter="formatter2"></el-table-column>
						<el-table-column prop="isidentity" label="是否自增长" show-overflow-tooltip :formatter="formatter3"> </el-table-column>
						<el-table-column prop="iskey" label="是否主键" show-overflow-tooltip :formatter="formatter1"></el-table-column>
						<el-table-column prop="col_des" label="列描述" show-overflow-tooltip></el-table-column>
						<el-table-column prop="memo" label="备注" show-overflow-tooltip></el-table-column>
						<el-table-column label="操作" width="160">
							<template slot-scope="scope">
								<el-button size="small" type="primary" @click="showServerEdit(scope.$index,scope.row)">编辑</el-button>
								<el-button size="small" type="primary" @click="delServerEdit(scope.$index,scope.row)">删除</el-button>
							</template>
						</el-table-column>
					</el-table>
				</el-card>
			</el-col>
		</el-row>

		<!--导入数据主表明细-->
		<el-dialog :title="text" :visible.sync="addFormVisible" :close-on-click-modal="false" style="padding-bottom:0;" @close="resetForm('addForm')">
			<el-form :model="addForm" label-width="80px" ref="addForm" style="height:240px;" :rules="addFormRules">
				<el-form-item label="表名称" prop="table_name">
					<el-input v-model="addForm.table_name" auto-complete="off" placeholder="请输入表的描述" :disabled="input_disabled"></el-input>
				</el-form-item>
				<el-form-item label="描述" prop="describe">
					<el-input v-model="addForm.describe" auto-complete="off" placeholder="请输入表名称"></el-input>
				</el-form-item>
			
				<el-form-item label="项目" prop="project">
					<el-select  allow-create  v-model="addForm.project" placeholder="请选择" default-first-option filterable style='width:100%'>
						<el-option v-for="(item,index) in project_name" :key="index" :label='item.project' :value="item.project"  >
						</el-option>
					</el-select>
				</el-form-item>

			</el-form>
			<div slot="footer" class="dialog-footer" style="text-align: left; margin-left:30px;margin-left:80px;">
				<el-button type="primary" @click.native="addServerMaster">提交</el-button>
				<el-button @click="reset()">重置</el-button>
			</div>
		</el-dialog>

		<!--修改明细-->
		<el-dialog :title="text" :visible.sync="addFormVisible1" :close-on-click-modal="false" style="padding-bottom:0;" @close="resetForm('addForm')">
			<el-form :model="addForm" label-width="80px" ref="addForm" style="height:240px;" :rules="addFormRules">
				<el-form-item label="表名称" prop="table_name">
					<el-input v-model="addForm.table_name" auto-complete="off" placeholder="请输入表名称" :disabled="input_disabled"></el-input>
				</el-form-item>
				<el-form-item label="描述" prop="describe">
					<el-input v-model="addForm.describe" auto-complete="off" placeholder="请输入表的描述"></el-input>
				</el-form-item>
			</el-form>
			<div slot="footer" class="dialog-footer" style="text-align: left; margin-left:30px;margin-left:80px;">
				<el-button type="primary" @click.native="addServerMaster1">提交</el-button>
				<el-button @click="resettable()">重置</el-button>
			</div>
		</el-dialog>

		<!--新增脚本-->
		<el-dialog :title="text" :visible.sync="addFormVisible2" :close-on-click-modal="false" style="padding-bottom:0;">
			<el-form :model="addForm1" label-width="80px" ref="addForm1" style="height:240px;" :rules="addFormRules">
				<el-form-item label="脚本文件:" prop="cmd">
					<el-input type="textarea" :rows="12" v-model="addForm1.cmd" id="text" auto-complete="off"></el-input>
				</el-form-item>
			</el-form>
			<div slot="footer" class="dialog-footer" style="text-align: center; margin-left:30px;margin-left:80px;">
				<el-button type="primary" @click="myCopy()">点击复制文本框内的内容</el-button>
			</div>
		</el-dialog>

		<!--新增数据副表明细-->
		<el-dialog :title="text" :visible.sync="addDetailVisible" :close-on-click-modal="false" style="padding-bottom:0;">
			<el-form :model="addDbTableForm" label-width="80px" :rules="addDbTableFormRules" ref="addDbTableForm" style="height:300px;">
				<el-row :gutter="20">
					<el-col :span="12">
						<el-form-item label="列名" prop="colname">
							<el-input :disabled="input_disabled" v-model="addDbTableForm.colname" auto-complete="off" placeholder="请输入列名"></el-input>
						</el-form-item>
						<el-form-item label="数据类型" prop="datatype">
							<el-select v-model="addDbTableForm.datatype" placeholder="请选择数据类型">
								<el-option label="bigint" value="bigint"></el-option>
								<el-option label="binary" value="binary"></el-option>
								<el-option label="bit" value="bit"></el-option>
								<el-option label="char" value="char"></el-option>
								<el-option label="date" value="date"></el-option>
								<el-option label="datetime" value="datetime"></el-option>
								<el-option label="datetime2" value="datetime2"></el-option>
								<el-option label="datetimeoffset" value="datetimeoffset"></el-option>
								<el-option label="decimal" value="decimal"></el-option>
								<el-option label="float" value="float"></el-option>
								<el-option label="geography" value="geography"></el-option>
								<el-option label="geometry" value="geometry"></el-option>
								<el-option label="hierarchyid" value="hierarchyid"></el-option>
								<el-option label="image" value="image"></el-option>
								<el-option label="int" value="int"></el-option>
								<el-option label="money" value="money"></el-option>
								<el-option label="nchar" value="nchar"></el-option>
								<el-option label="ntext" value="ntext"></el-option>
								<el-option label="numeric" value="numeric"></el-option>
								<el-option label="nvarchar" value="nvarchar"></el-option>
								<el-option label="real" value="real"></el-option>
								<el-option label="smalldatetime" value="smalldatetime"></el-option>
								<el-option label="smallint" value="smallint"></el-option>
								<el-option label="smallmoney" value="smallmoney"></el-option>
								<el-option label="sql_variant" value="sql_variant"></el-option>
								<el-option label="sysname" value="sysname"></el-option>
								<el-option label="text" value="text"></el-option>
								<el-option label="time" value="time"></el-option>
								<el-option label="timestamp" value="timestamp"></el-option>
								<el-option label="tinyint" value="tinyint"></el-option>
								<el-option label="uniqueidentifier" value="uniqueidentifier"></el-option>
								<el-option label="varbinary" value="varbinary"></el-option>
								<el-option label="varchar" value="varchar"></el-option>
								<el-option label="xml" value="xml"></el-option>
							</el-select>
						</el-form-item>
						<el-form-item label="小数点位数" prop="scale" label-width="85px">
							<el-input-number v-model="addDbTableForm.scale" :min="1" :max="5" label="小数点位数"></el-input-number>
						</el-form-item>
						<el-form-item label="是否主键" prop="iskey">
							<template>
								<!-- `checked` 为 true 或 false -->
								<el-checkbox v-model="checked"></el-checkbox>
							</template>
						</el-form-item>
						<el-form-item label="默认值" prop="defvalue">
							<el-input v-model="addDbTableForm.defvalue" auto-complete="off" placeholder="请输入默认值"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="12">
						<div class="grid-content bg-purple">
							<el-form-item label="列描述" prop="col_des">
								<el-input v-model="addDbTableForm.col_des" auto-complete="off" placeholder="请输入列描述"></el-input>
							</el-form-item>
							<el-form-item label="长度" prop="collength">
								<el-input-number v-model="addDbTableForm.collength" :min="1" :max="600" label="描述文字"></el-input-number>
							</el-form-item>
							<el-form-item label="自增长" prop="isidentity">
								<template>
									<!-- `checked` 为 true 或 false -->
									<el-checkbox v-model="checked2"></el-checkbox>
								</template>
							</el-form-item>
							<el-form-item label="是否可空" prop="isnullable">
								<template>
									<!-- `checked` 为 true 或 false -->
									<el-checkbox v-model="checked1"></el-checkbox>
								</template>
							</el-form-item>
							<el-form-item label="备注" prop="memo">
								<el-input v-model="addDbTableForm.memo" auto-complete="off" placeholder="请输入备注"></el-input>
							</el-form-item>
						</div>
					</el-col>
				</el-row>
			</el-form>
			<div slot="footer" class="dialog-footer" style="text-align: left; margin-left:30px;margin-left:80px;">
				<el-button type="primary" @click.native="addDbTableColumns">提交</el-button>
				<el-button @click="reset()">重置</el-button>
			</div>
		</el-dialog>
</div>
</template>

<script>
	import { query, apiparas, execute } from '../../api/api';
	import { Cookie } from '../../js/common';
	export default {
		data() {
			return {
				defaultProps: {
					children: 'subs',label: 'table_name',
				},
				addFormRules: {
					describe: [{
						required: true,message: '请输入表描述',trigger: 'blur'
					}, ],
					table_name: [{
						required: true,message: '请输入表名称',trigger: 'blur'
					}, ],
					project: [{
						required: true,message: '请输入项目名称',trigger: 'blur'
					}, ],
				},
				addDbTableFormRules: {
					colorder: [{
						required: true,message: '请输入序号',trigger: 'blur'
					}, ],
					colname: [{
						required: true,message: '请输入列名',trigger: 'blur'
					}, ],

					col_des: [{
						required: true,message: '请输入列描述',trigger: 'blur'
					}]
				},
				addDbTableForm: {
					columns_key: '',table_key: '',colorder: '',colname: '',
					col_des: '',datatype: '',collength: '',scale: '',
					isidentity: '',iskey: '',isnullale: '',defvalue: '',
					memo: '',
				},
				addForm1: {
					cmd: '',
				},
				addForm: {
					table_name: '',
					describe: '',
					project: '',
				},
				input_disabled: false,
				isEditShow: false,
				addDetailVisible: false,
				addFormVisible: false,
				addFormVisible1: false,
				addFormVisible2: false,
				textarea: '',
				items: [],
				DbTableData: [],
				showHow: '',
				table_key: '',
				project_name:[],
				text: '',
				table_name: '',
				remarks: '',
				p_Dbname_de: '',
				tablename: [],
				project: '',
				p_Dbtable_de: '',
				newscript: '',
				checked: false,
				checkedSpring: '',
				checked1: false,
				checkedSpring1: '',
				checked2: false,
				checkedSpring2: '',
				selectRow:{}
			}
		},
		computed: {
			onRoutes() {
				return this.$route.path.replace('/', '');
			}
		},
		methods: {
			formatter1(row, column, cellValue, index) {
				return row.iskey === true ? '是' : row.iskey === false ? '否' : '未知';
			},
			formatter2(row, column, cellValue, index) {
				return row.isnullable === true ? '是' : row.isnullable === false ? '否' : '未知';
			},
			formatter3(row, column, cellValue, index) {
				return row.isidentity === true ? '是' : row.isidentity === false ? '否' : '未知';
			},
			
			//处理（更新数据库主表）修改
			addServerMaster1() {
				let jsonparas = [
				{'name': 'table_key','value': this.table_key},
				{'name': 'table_name','value': this.addForm.table_name},
				{'name': 'describe','value': this.addForm.describe},
				{'name': 'project','value': this.addForm.project}
				]
				//查询汇总
				let _paras = apiparas.getParas('default', 'sys|update_server_master', jsonparas);
				execute(_paras).then(response => {
					if(response.errid == 0) {
						this.addFormVisible1 = false;
						this.textarea=this.addForm.describe;
						this.$notify({
							title: '成功信息',message: '修改成功！',type: 'success',duration: 1500
						});
						this.showdata();
					} else {
						this.$notify.error({
							title: '错误',message: response.errmsg,type: 'error',duration: 1500
						});
					}
				});
			},

			//处理导入
			addServerMaster() { 
				let jsonparas = [];
				//增加查询条件
				//查询汇总
				apiparas.pushPara(jsonparas, 'table_name', this.addForm.table_name);
				let _paras = apiparas.getParas('default', 'sys|get_server_name', jsonparas);
				query(_paras).then(response => {
					var json_data = response.result;
					this.tablename = json_data;
					if(this.tablename.length < 1) {
						this.import_success();
						this.showdata();
					} else {
						this.$confirm('此表已经存在，此操作将重新导入该数据库表, 是否继续?', '提示', {
							confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'
						}).then(() => {
							this.import_success();
						}).catch(() => {
							this.$message({
								type: 'info',
								message: '已取消导入'
							});
						});
					}
				});
			},
			
			//如果数据库中存在该表，（进行删除再插入） 
			import_success() {
				let jsonparas = [
				{'name': 'table_name','value': this.addForm.table_name}, 
				{'name': 'describe','value': this.addForm.describe},
				{'name': 'project','value': this.addForm.project}
				]
				let _paras = apiparas.getParas('default', 'sys|import_server_table', jsonparas);
				execute(_paras).then(response => {
					if(response.errid == 0) {
						this.addFormVisible = false;
						this.$notify({
							title: '成功信息',message: '修改成功！',type: 'success',duration: 1500
						});
						this.showdata();
					} else {
						this.$notify.error({
							title: '错误',message: response.errmsg,type: 'error',duration: 1500
						});
					}
				});
			},

			//导入数据库表
			import_table() {
				this.text = '导入';
				this.addFormVisible = true;
				this.input_disabled = false;
				this.isEditShow = false;
				this.addForm.table_name = '';
				this.addForm.describe = '';
				this.get_project();
			},
			
			//修改主表的按钮事件
			updateDbtableEdit(val) {
				this.addFormVisible1 = true;
				this.text = '编辑';
				this.input_disabled = true;
				this.addForm.table_name = this.table_name;
				this.addForm.describe = this.textarea; //this.textarea
				this.addForm.remarks = this.remarks;
				this.addForm.project = this.project;
				this.isEditShow = true;
			},

			addDbTableColumns() { //修改数据库副表信息
				if(this.isEditShow) {
					//增加查询条件
					if(this.checked === true) {
						this.checkedSpring = 'true';
					} else {
						this.checkedSpring = 'false';
					}
					if(this.checked1 === true) {
						this.checkedSpring1 = 'true';
					} else {
						this.checkedSpring1 = 'false';
					}
					if(this.checked2 === true) {
						this.checkedSpring2 = 'true';
					} else {
						this.checkedSpring2 = 'false';
					}
					let jsonparas = [
						{'name': 'columns_key','value': this.addDbTableForm.columns_key}, 
						{'name': 'table_key','value': this.table_key}, 
						{'name': 'colorder','value': this.addDbTableForm.colorder}, 
						{'name': 'colname','value': this.addDbTableForm.colname},
						{'name': 'col_des','value': this.addDbTableForm.col_des},
						{'name': 'datatype','value': this.addDbTableForm.datatype},
						{'name': 'collength','value': this.addDbTableForm.collength}, 
						{'name': 'scale','value': this.addDbTableForm.scale},
						{'name': 'isidentity','value': this.checkedSpring2}, 
						{'name': 'iskey','value': this.checkedSpring}, 
						{'name': 'isnullable','value': this.checkedSpring1},
						{'name': 'defvalue','value': this.addDbTableForm.defvalue}, 
						{'name': 'memo','value': this.addDbTableForm.memo}
					];
					//查询汇总
					let _paras = apiparas.getParas('default', 'sys|update_server_tableColumns', jsonparas);
					execute(_paras).then(response => {
						if(response.errid == 0) {
							this.addDetailVisible = false;
							this.$notify({
								title: '成功信息',message: '修改成功！',type: 'success',duration: 1500
							});
							this.getDict();
						} else {
							this.$notify.error({
								title: '错误',message: response.errmsg,type: 'error',duration: 1500
							});
						}
					});
				}
			},
			
			//当点击菜单按钮的表时，执行的操作
			onselect(index, indexPath) {
				//寻找对应表的key值和描述，方便传递到另一个卡片表格中
				if(index > 0) {
					for(let i = 0; i < this.items.length; i++) {
						for(let j = 0; j < this.items[i].subs.length; j++) {
							if(this.items[i].subs[j].id == index) {
								this.textarea = this.items[i].subs[j].describe;
								this.table_key = this.items[i].subs[j].id;
								this.table_name = this.items[i].subs[j].table_name;
								this.p_Dbname_de = '';
								//显示数据
								this.getDict();
								return;
							}
						}
						/*	//显示数据  放在这里 会有问题
							this.getDict();*/
					}
				} else {
					console.log(index);
				}
			},
			
			//获取数据库副表信息
			getDict: function() {
				let jsonparas = [];
				//增加查询条件
				apiparas.pushPara(jsonparas, 'table_key', this.table_key);
				apiparas.pushPara(jsonparas, 'colname', this.p_Dbname_de);
				//查询汇总
				let _paras = apiparas.getParas('default', 'sys|get_server_tableColumns', jsonparas);
				query(_paras).then(response => {
					this.DbTableData = response.result;
				});
			},
			
			//数据库副表的修改
			showServerEdit(index, row) {
				this.addDetailVisible = true;
				this.input_disabled = false;
				this.text = '编辑';
				this.input_disabled = true;
				this.addDbTableForm.table_key = row.table_key;
				this.addDbTableForm.columns_key = row.columns_key;
				this.addDbTableForm.scale = row.scale;
				this.addDbTableForm.isnullable = row.isnullable;
				this.addDbTableForm.isidentity = row.isidentity;
				this.addDbTableForm.colorder = row.colorder;
				this.addDbTableForm.iskey = row.iskey;
				this.addDbTableForm.datatype = row.datatype;
				this.addDbTableForm.collength = row.collength;
				this.addDbTableForm.col_des = (row.col_des==null?'':row.col_des);
				this.addDbTableForm.colname = row.colname;
				this.addDbTableForm.memo = (row.memo==null?'':row.memo);
				this.addDbTableForm.defvalue = (row.defvalue==null?'':row.defvalue);
				this.isEditShow = true;
				this.checked = this.addDbTableForm.iskey;
				this.checked1 = this.addDbTableForm.isnullable;
				this.checked2 = this.addDbTableForm.isidentity;
				this.selectRow=row;
			},
			
			//删除脚本
			delete_script() {
				this.addFormVisible2 = true;
				this.showHow = 3;
				this.select_script();
			},
			
			//修改脚本
			update_script() {
				this.addFormVisible2 = true;
				this.showHow = 2;
				this.select_script();
			},
			
			//删除脚本
			add_script() {
				this.addFormVisible2 = true;
				this.showHow = 1;
				this.select_script();
			},
			
			//选择按下的是那个脚本按钮
			select_script() {
				if(this.showHow === 1) {
					let jsonparas = [];
					apiparas.pushPara(jsonparas, 'table_name', this.table_name);
					let paras = apiparas.getParas_rtype('default', 'sys|generate_insert', 0, jsonparas);
					query(paras).then(response => {
						let json_data = response.result;
						this.newscript = json_data;
						this.addForm1.cmd = this.newscript[0].cmd;
					});
				} else if(this.showHow === 2) {
					let jsonparas = [];
					apiparas.pushPara(jsonparas, 'table_name', this.table_name);
					let paras = apiparas.getParas_rtype('default', 'sys|generate_update', 0, jsonparas);
					query(paras).then(response => {
						let json_data = response.result;
						this.newscript = json_data;
						this.addForm1.cmd = this.newscript[0].cmd;
					});
				} else if(this.showHow === 3) {
					let jsonparas = [];
					apiparas.pushPara(jsonparas, 'table_name', this.table_name);
					let paras = apiparas.getParas_rtype('default', 'sys|generate_delete', 0, jsonparas);
					query(paras).then(response => {
						let json_data = response.result;
						this.newscript = json_data;
						this.addForm1.cmd = this.newscript[0].cmd;
					});
				}
			},
			
			//查询数据库表数据
			showdata: function() {
				//显示数据
				let jsonparas = [];
				apiparas.pushPara(jsonparas, 'table_name', this.p_Dbtable_de);
				let token = Cookie.Get("token");
				let paras = apiparas.getParas_rtype('default', 'sys|get_server_table', 3, jsonparas);
				query(paras).then(response => {
					var json_data = response.result;
					this.items = json_data;
				});
				this.DbTableData = [];
			},
			
			//获取项目
			get_project(){
					let jsonparas = [];
				let paras = apiparas.getParas_rtype('default', 'sys|get_project', 0, jsonparas);
				query(paras).then(response => {
					var json_data = response.result;
					this.project_name = json_data;
					console.log(this.project_name,"aass");
				});
			},

			//删除列的数据
			delServerEdit(index, indexPath) {
				var jsonparas = [];
				apiparas.pushPara(jsonparas, 'columns_key', indexPath.columns_key);
				let _paras = apiparas.getParas('default', 'sys|del_server_tableColumns', jsonparas);
				execute(_paras).then(response => {
					if(response.errid == 0) {
						this.$notify({
							title: '删除',message: '成功删除',type: 'success'
						});
						this.getDict();
					} else {
						this.$notify.error({
							title: '错误',message: '删除失败'
						});
					}
				});
				this.getDict();
			},
			
			//脚本文件的复制
			myCopy() {
				var ele = document.getElementById("text");
				ele.select();
				document.execCommand("Copy");
				this.addFormVisible2 = false;
			},
			resetForm: function(form) { //重置
			  this.$refs[form].resetFields()
			},
			resettable(){
				if(this.isEditShow){
					this.addForm = {
						table_name:this.table_name,
						describe:this.textarea,
					};
				}
			},
			//重置
			reset:function(){
			if (this.isEditShow) {
					this.addDbTableForm.table_key = this.selectRow.table_key;
					this.addDbTableForm.colorder = this.selectRow.colorder;
					this.addDbTableForm.colname = this.selectRow.colname;
					this.addDbTableForm.col_des = (this.selectRow.col_des==null?'':this.selectRow.col_des);
					this.addDbTableForm.datatype = this.selectRow.datatype;
					this.addDbTableForm.collength = this.selectRow.collength;
					this.addDbTableForm.scale = this.selectRow.scale;
					this.checked2 = this.selectRow.isidentity;
					this.checked = this.selectRow.iskey;
					this.checked1 = this.selectRow.isnullable;
				this.addDbTableForm.memo = (this.selectRow.memo==null?'':this.selectRow.memo);
				this.addDbTableForm.defvalue = (this.selectRow.defvalue==null?'':this.selectRow.defvalue);
				}else{
					this.addForm = {
						table_name:'',
						describe:'',
						project:''
					};
				}
		}
			},
		created: function() {
			this.showdata();
		}
	};
</script>

<style>
	.el-header {
		background-color: #B3C0D1;
		color: #333;
		line-height: 60px;
	}
	.el-aside {
		color: #333;
	}
	.setheight_scroller {
		height: 650px;
		overflow: auto;
	}
	.controlwidth {
		width: 50px;
	}
</style>